package test;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class Gongsitest {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        Gongsi a=new Gongsi();
        a.dizhi="铜锣湾";
        a.dianhuahaoma=1888888888;
        a.jingyingfanwei="砍人，偷车，看地盘,搞事情";
        int choice;
        while (true){
            System.out.println("1:查看公司信息，2：员工类操作,3客户类操作,4:退出");
            choice=in.nextInt();
            if (choice==1){
                a.shuchugongsi();
            }else if (choice==2){
                System.out.println("1:新增员工，2：删除员工");
                choice=in.nextInt();
                if (choice==1){
                    System.out.println("请输入员工姓名");
                    String name=in.next();
                    a.addyuangong(name);
                }
                if (choice==2){
                    System.out.println("请输入要删除的员工姓名");
                    String shanchuname=in.next();
                    a.deleteyuangong(shanchuname);
                }
            }else if (choice==3){
                System.out.println("1:新增客户，2：删除客户，3:查看客户");
                choice=in.nextInt();
                if (choice==1){
                    System.out.println("请输入客户姓名");
                    String name=in.next();
                    a.addkehu(name);
                }
                if (choice==2){
                    System.out.println("请输入要删除的客户姓名");
                    String shanchuname=in.next();
                    a.deletekehu(shanchuname);
                }
                if (choice==3){
                    System.out.println("请输入要查看第几个位置的客户");
                    int chakankehu=in.nextInt()-1;
                    String kehu = a.findkehu(chakankehu);//!!!!!!
                    if(kehu==null){
                        System.out.println("此位置无人");
                    }else
                        System.out.println("找到了："+kehu);
                }
            }
        }
    }
}
